//=================================================================================================
// DESC: easy access of parallel port
// AUTHOR: wiRe (http://w1r3.de/)
// DATE: 07/04/2006
//
// Copyright (c)2006 wiRe
//=================================================================================================
#pragma once


class PPort
{
private:
  static short DefaultBasePortList[];
  typedef struct {short port,bit; bool inv;} PinDesc;
  static PinDesc PinLookUp[];

public:
  PPort() {BasePort = -1;}

  bool init(short baseport = -1);
  bool autodetect();
  bool get(short pin);
  void set(short pin, bool state=true);
  void clr(short pin);
  bool toggle(short pin);

public:
  short BasePort;
};